// index.js
// 获取应用实例
const app = getApp()
const fetch = require('../../utils/fetch.js')
Page({
  data: {
    indicatorDots: true,
    autoplay: true,
    interval: 5000,
    duration: 1000,
    banner: [],
    bottom: []
  },
  // 事件处理函数
  bindViewTap() {
    wx.navigateTo({
      url: '../logs/logs'
    })
  },
  onLoad() {
    if (wx.getUserProfile) {
      this.setData({
        canIUseGetUserProfile: true
      })
    }
  },
  onLoad: function (options) {
    wx.showLoading({
      title: '努力加载中',
    })
    fetch('banner').then(res => {
      wx.hideLoading();
      console.log(res.data)
      this.setData({
        banner: res.data
      })
    }, () => {
      wx.hideLoading()
    })
    fetch('bottom-box').then(res => {
      wx.hideLoading();
      console.log(res.data)
      this.setData({
        bottom: res.data
      })
    }, () => {
      wx.hideLoading()
    })
  },
  gostart: function () {
    wx.navigateTo({
      url: '../list/list',
    })
  }
})
